/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package helloworld;

/**
 *
 * @author Robbin
 */
public class Person {

    private String name;
    private int age;


    public Person(String name, int age) {
        if (age < 0) {
            age = 0;
        }
        this.age = age;

        this.name = name;
    }

    /**
     * @return the name
     */
    public String getName() {
        return this.name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
            this.name = name;
        
        
    }

    /**
     * @return the age
     */
    public int getAge() {
        return age;
    }

    /**
     * @param age the age to set
     */
    public void setAge(int age) {
        if (age < 0) {
            age = 0;
        }
        this.age = age;


    }

    //reverts string
    public void reverseName() {

        StringBuffer buffer = new StringBuffer(name);
        buffer = buffer.reverse();
        String reverseString = buffer.toString();
        System.out.println(reverseString);
    }
}
